package pandora.dto;
//
import java.util.Date;

public class PriceDTO implements Comparable{
	
	private ProductDTO product;
	private StoreDTO store;
	private Date lastDate;
	private Integer price;
	private Boolean valid;
	
	public PriceDTO(){}
	
	public PriceDTO(ProductDTO producto) {
		this.product = producto;
	}

	public PriceDTO(ProductDTO product, StoreDTO store, Date lastDate,
			Integer price, Boolean valid) {
		this.product = product;
		this.store = store;
		this.lastDate = lastDate;
		this.price = price;
		this.valid = valid;
	}

	public Date getLastDate() {
		return lastDate;
	}
	
	public void setLastDate(Date lastDate) {
		this.lastDate = lastDate;
	}
	
	public Integer getPrice() {
		return price;
	}
	
	public void setPrice(Integer price) {
		this.price = price;
	}
	
	public boolean isValid() {
		return valid;
	}
	
	public void setValid(boolean valid) {
		this.valid = valid;
	}
	
	public String toString(){
		super.toString();
		String s = this.getPrice().toString();
		return s;
	}

	public void setProduct(ProductDTO product) {
		this.product = product;
	}

	public ProductDTO getProduct() {
		return product;
	}

	public void setStore(StoreDTO store) {
		this.store = store;
	}

	public StoreDTO getStore() {
		return store;
	}

	public int compareTo(Object o) {
	
		return (this.getPrice()-((PriceDTO) o).getPrice());
		
	}
	
}
